<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>📚 ReadCat 书籍管理系统</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { 
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #333;
            padding: 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.2);
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .header h1 {
            color: #4CAF50;
            font-size: 2.5em;
            margin-bottom: 10px;
        }
        .status-bar {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .status-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .status-badge {
            background: #4CAF50;
            color: white;
            padding: 5px 10px;
            border-radius: 15px;
            font-size: 0.9em;
        }
        .section {
            margin-bottom: 30px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 15px;
        }
        .section h2 {
            color: #4CAF50;
            margin-bottom: 15px;
            border-bottom: 2px solid #4CAF50;
            padding-bottom: 10px;
        }
        .book-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 15px;
        }
        .book-card {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }
        .book-card:hover {
            transform: translateY(-5px);
        }
        .book-title {
            font-weight: bold;
            font-size: 1.2em;
            margin-bottom: 5px;
            color: #333;
        }
        .book-author {
            color: #666;
            margin-bottom: 10px;
        }
        .btn {
            background: #4CAF50;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            margin-right: 10px;
            transition: background 0.3s ease;
        }
        .btn:hover {
            background: #45a049;
        }
        .file-drop {
            border: 2px dashed #4CAF50;
            border-radius: 10px;
            padding: 40px;
            text-align: center;
            margin-top: 10px;
            background: rgba(76, 175, 80, 0.1);
        }
        .library-stats {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        .stat-card {
            flex: 1;
            background: white;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .stat-number {
            font-size: 2em;
            font-weight: bold;
            color: #4CAF50;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>📚 ReadCat 书籍管理系统</h1>
            <p>模块化书籍下载与管理系统</p>
        </div>

        <div class="status-bar">
            <div class="status-item">
                <span>🔧 系统状态:</span>
                <span class="status-badge">运行中</span>
            </div>
            <div class="status-item">
                <span>📦 已加载模块:</span>
                <span class="status-badge">4</span>
            </div>
            <div class="status-item">
                <span>📚 书库书籍:</span>
                <span class="status-badge">1</span>
            </div>
        </div>

        <div class="section">
            <h2>📥 书籍下载</h2>
            <div class="book-grid">
                <div class="book-card">
                    <div class="book-title">西游记</div>
                    <div class="book-author">作者：吴承恩</div>
                    <button class="btn" onclick="downloadBook('西游记')">下载</button>
                </div>
                <div class="book-card">
                    <div class="book-title">红楼梦</div>
                    <div class="book-author">作者：曹雪芹</div>
                    <button class="btn" onclick="downloadBook('红楼梦')">下载</button>
                </div>
                <div class="book-card">
                    <div class="book-title">水浒传</div>
                    <div class="book-author">作者：施耐庵</div>
                    <button class="btn" onclick="downloadBook('水浒传')">下载</button>
                </div>
                <div class="book-card">
                    <div class="book-title">三国演义</div>
                    <div class="book-author">作者：罗贯中</div>
                    <button class="btn" onclick="downloadBook('三国演义')">下载</button>
                </div>
            </div>
        </div>

        <div class="section">
            <h2>📁 文件导入</h2>
            <div class="file-drop" id="fileDrop">
                <p>拖拽文件到此处或点击选择文件</p>
                <p><small>支持 .txt, .epub, .pdf 格式</small></p>
                <input type="file" id="fileInput" accept=".txt,.epub,.pdf" style="display: none;">
                <button class="btn" onclick="document.getElementById('fileInput').click()">选择文件</button>
            </div>
        </div>

        <div class="section">
            <h2>📖 我的书库</h2>
            <div class="library-stats">
                <div class="stat-card">
                    <div class="stat-number">1</div>
                    <div>本书籍</div>
                </div>
                <button class="btn" onclick="refreshLibrary()">刷新</button>
                <button class="btn" onclick="exportLibrary()">导出</button>
            </div>
            
            <div class="book-grid">
                <div class="book-card">
                    <div class="book-title">西游记</div>
                    <div class="book-author">未知作者</div>
                    <div style="font-size: 0.9em; color: #666; margin-bottom: 10px;">
                        大小: 53 B | 添加时间: 2025/10/2
                    </div>
                    <button class="btn" onclick="readBook('西游记')">阅读</button>
                    <button class="btn" style="background: #f44336;" onclick="deleteBook('西游记')">删除</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 书籍下载功能
        function downloadBook(title) {
            alert(`开始下载《${title}》...`);
            // 这里可以添加实际的下载逻辑
            console.log(`下载书籍: ${title}`);
        }

        // 文件拖拽功能
        const fileDrop = document.getElementById('fileDrop');
        fileDrop.addEventListener('dragover', (e) => {
            e.preventDefault();
            fileDrop.style.background = 'rgba(76, 175, 80, 0.2)';
        });

        fileDrop.addEventListener('dragleave', () => {
            fileDrop.style.background = 'rgba(76, 175, 80, 0.1)';
        });

        fileDrop.addEventListener('drop', (e) => {
            e.preventDefault();
            fileDrop.style.background = 'rgba(76, 175, 80, 0.1)';
            const files = e.dataTransfer.files;
            handleFiles(files);
        });

        document.getElementById('fileInput').addEventListener('change', (e) => {
            handleFiles(e.target.files);
        });

        function handleFiles(files) {
            if (files.length > 0) {
                const file = files[0];
                alert(`成功导入文件: ${file.name}`);
                console.log('导入文件:', file);
            }
        }

        // 书库功能
        function refreshLibrary() {
            alert('刷新书库...');
            console.log('刷新书库');
        }

        function exportLibrary() {
            alert('导出书库...');
            console.log('导出书库');
        }

        function readBook(title) {
            alert(`开始阅读《${title}》...`);
            // 跳转到阅读页面
            window.open('readcat-main.html', '_blank');
        }

        function deleteBook(title) {
            if (confirm(`确定要删除《${title}》吗？`)) {
                alert(`已删除《${title}》`);
                console.log(`删除书籍: ${title}`);
            }
        }

        // 页面加载完成后的初始化
        document.addEventListener('DOMContentLoaded', function() {
            console.log('ReadCat 书籍管理系统已加载');
        });
    </script>
</body>
</html>